package com.csii.mytest.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by 顾博君 on 2017/3/1.
 */


public class MySQLiteHelper extends SQLiteOpenHelper {
    //表名
    public static final String TABLEC_NAME = "tablecptest";
    //版本
    public static final int DB_VERSION = 1;


    public MySQLiteHelper(Context context) {
        super(context, TABLEC_NAME, null, DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        String strSQL = "create table " + TABLEC_NAME +
                "(id integer primary key autoincrement," +
                "name varchar(64)," +
                "address varchar(64))";
        sqLiteDatabase.execSQL(strSQL);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
    }
}
